<?php
/**
*
* 功能描述（主页数据）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*/

class ModelIndex extends ModelBase
{
	function GetDisImg()
	{
		$cur_conf = $this->GetSysConf('index_img');
		$data = array();
		foreach($cur_conf as $item)
		{
			$data[] = array(
				'src' => './data/'.$item['key'] . '_'.$item['id'].'.jpg',
				'url' => $item['param'],
				'text' => $item['value'],
				'sort' => $item['sort'],
			);
		}
		return $data;
	}

	function GetShowCake()
	{
		$where = "visible = 1 and type != 1";
		$order = "type2 desc, sales desc, updatetime desc";
		$data = $this->db->getAll("goods_base", "id, name, `type`, `type2`, `discount`,  introduce", $where, $order, 8);
		if(!$data)
			return array();
		return $data;
	}
}

